//
//  alertView.m
//  zhangGuangTianXia
//
//  Created by tangtangchitangtang on 2017/11/9.
//  Copyright © 2017年 tangtangchitangtang. All rights reserved.
//

#import "alertView.h"

@implementation alertView

-(void)creatView{
    self.backgroundColor=[UIColor colorWithRed:0 green:0 blue:0 alpha:0.3];

    UIView *alertView=[UIView new];
    [self addSubview:alertView];
    [alertView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(25);
        make.right.mas_equalTo(-25);
        make.centerY.mas_equalTo(0);
        make.height.mas_equalTo(210);
    }];
    alertView.backgroundColor=[UIColor whiteColor];
    alertView.layer.cornerRadius=5;
    
    UILabel *lable=[UILabel new];
    [alertView addSubview:lable];
    [lable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30);
        make.centerY.mas_equalTo(-50);
    }];
    [lable layoutIfNeeded];
    lable.text=@"退出登录";
    lable.textColor=ColorWithRGB(10, 10, 10);
    lable.font=[UIFont systemFontOfSize:27];
    
    UILabel *label2=[UILabel new];
    [alertView addSubview:label2];
    [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(30);
        make.top.mas_equalTo(lable.mas_bottom).mas_equalTo(20);
    }];
    [label2 layoutIfNeeded];
    label2.textColor=ColorWithRGB(100, 100, 100);
    label2.text=@"是否确定退出登录";
    label2.font=[UIFont systemFontOfSize:20];
    
    _okBtn=[UIButton new];
    [alertView addSubview:_okBtn];
    [_okBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-20);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(60);
        make.bottom.mas_equalTo(-15);
    }];
    [_okBtn setTitle:@"确定" forState:0];
    [_okBtn setTitleColor:_tianLanColor forState:0];
    _okBtn.titleLabel.font=[UIFont systemFontOfSize:20];

    UIButton *queXiao=[UIButton new];
    [alertView addSubview:queXiao];
    [queXiao mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(_okBtn.mas_left).mas_equalTo(-20);
        make.width.mas_equalTo(50);
        make.height.mas_equalTo(60);
        make.bottom.mas_equalTo(-15);
    }];
    [queXiao setTitle:@"取消" forState:0];
    [queXiao setTitleColor:ColorWithRGB(200, 200, 200) forState:0];
    queXiao.titleLabel.font=[UIFont systemFontOfSize:20];
    [queXiao addTarget:self action:@selector(tuiChuView) forControlEvents:UIControlEventTouchUpInside];

}
-(void)tuiChuView{
    [self removeFromSuperview];
    
}
@end
